home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsISVGRenderer.idl < prev    next >
Text File  |  2006-05-08  |  7KB  |  179 lines

  1. /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is the Mozilla SVG project.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Crocodile Clips Ltd.
  19.  * Portions created by the Initial Developer are Copyright (C) 2002
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *   Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
  24.  *
  25.  * Alternatively, the contents of this file may be used under the terms of
  26.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  27.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  28.  * in which case the provisions of the GPL or the LGPL are applicable instead
  29.  * of those above. If you wish to allow use of your version of this file only
  30.  * under the terms of either the GPL or the LGPL, and not to allow others to
  31.  * use your version of this file under the terms of the MPL, indicate your
  32.  * decision by deleting the provisions above and replace them with the notice
  33.  * and other provisions required by the GPL or the LGPL. If you do not delete
  34.  * the provisions above, a recipient may use your version of this file under
  35.  * the terms of any one of the MPL, the GPL or the LGPL.
  36.  *
  37.  * ***** END LICENSE BLOCK ***** */
  38.  
  39. #include "nsISupports.idl"
  40.  
  41. %{C++
  42. struct nsRect;
  43. %}
  44.  
  45. [ref] native nsRectRef(nsRect);
  46.  
  47.  
  48. interface nsISVGPathGeometrySource;
  49. interface nsISVGGlyphMetricsSource;
  50. interface nsISVGGlyphGeometrySource;
  51. interface nsISVGRendererPathGeometry;
  52. interface nsISVGRendererGlyphMetrics;
  53. interface nsISVGRendererGlyphGeometry;
  54. interface nsISVGRendererCanvas;
  55. interface nsISVGRendererSurface;
  56. interface nsIRenderingContext;
  57. interface nsISVGRendererRegion;
  58. interface nsPresContext;
  59.  
  60. /**
  61.  * \addtogroup renderer_interfaces Rendering Engine Interfaces
  62.  * @{
  63.  */
  64.  
  65. /**
  66.  * One of a number of interfaces (all starting with nsISVGRenderer*)
  67.  * to be implemented by an SVG rendering engine. 
  68.  *
  69.  * This interface serves as a factory for rendering engine-related
  70.  * objects. Each rendering engine needs to make available an
  71.  * nsIRenderer-object with a contract id of the form
  72.  * "@mozilla.org/svg/renderer;1?tech=NAME".
  73.  *
  74.  * Engines implemented at the moment include an ms windows gdi+ engine
  75.  * ("@mozilla.org/svg/renderer;1?tech=GDIPLUS") and a (somewhat)
  76.  * cross-platform libart engine
  77.  * ("@mozilla.org/svg/renderer;1?tech=LIBART").
  78.  */
  79. [scriptable, uuid(14e914e0-f283-4fd0-9d71-d3e842927007)]
  80. interface nsISVGRenderer : nsISupports
  81. {
  82.   // void Init(in nsPresContext presContext);
  83.   
  84.   /**
  85.    * Create a rendering engine-native path geometry object for the
  86.    * source object given by 'src'.
  87.    *
  88.    * @param src The source object describing the path for which
  89.    * this object is being created.
  90.    * @return A rendering engine-native path geometry object.
  91.    */
  92.   nsISVGRendererPathGeometry createPathGeometry(in nsISVGPathGeometrySource src);
  93.  
  94.   /**
  95.    * Create a rendering engine-native glyph metrics object for the
  96.    * source object given by 'src'.
  97.    *
  98.    * @param src The source object describing the glyph for which
  99.    * this metrics object is being created.
  100.    * @return A rendering engine-native glyph metrics object.
  101.    */
  102.   nsISVGRendererGlyphMetrics createGlyphMetrics(in nsISVGGlyphMetricsSource src);
  103.  
  104.   /**
  105.    * Create a rendering engine-native glyph geometry object for the
  106.    * source object given by 'src'.
  107.    *
  108.    * @param src The source object describing the glyph for which
  109.    * this object is being created.
  110.    * @return A rendering engine-native glyph geometry object.
  111.    */
  112.   nsISVGRendererGlyphGeometry createGlyphGeometry(in nsISVGGlyphGeometrySource src);
  113.   
  114.   /**
  115.    * Create a rendering engine-native canvas object for the
  116.    * Mozilla-native rendering context 'ctx' and presentation context
  117.    * 'presContext'.
  118.    *
  119.    * @param ctx Mozilla-native rendering context.
  120.    * @param presContext Presentation context.
  121.    * @param dirtyRect Area that the canvas should cover.
  122.    * @return A rendering engine-native canvas object.
  123.    */
  124.   [noscript] nsISVGRendererCanvas createCanvas(in nsIRenderingContext ctx,
  125.                                                in nsPresContext presContext,
  126.                                                [const] in nsRectRef dirtyRect);
  127.  
  128.   /**
  129.    * Create a rendering engine-native region object for the
  130.    * given axis-aligned rectangle.
  131.    *
  132.    * @param x X-coordinate of rectangle (pixels).
  133.    * @param y Y-coordinate of rectangle (pixels).
  134.    * @param width Width of rectangle (pixels).
  135.    * @param height Height of rectangle (pixels).
  136.    *
  137.    * @return A rendering engine-native region object.
  138.    */
  139.   nsISVGRendererRegion createRectRegion(in float x, in float y, in float width, in float height);
  140.  
  141.   /**
  142.    * Create a rendering engine-native surface object.
  143.    *
  144.    * @param width Width of rectangle (pixels).
  145.    * @param height Height of rectangle (pixels).
  146.    *
  147.    * @return A rendering engine-native surface object.
  148.    */
  149.   [noscript] nsISVGRendererSurface createSurface(in unsigned long width, in unsigned long height);
  150. };
  151.  
  152. /** @} */
  153.  
  154.  
  155. %{C++
  156.     
  157. #define NS_SVG_RENDERER_CONTRACTID         "@mozilla.org/svg/renderer;1"
  158. #define NS_SVG_RENDERER_CONTRACTID_PREFIX  NS_SVG_RENDERER_CONTRACTID "?tech="
  159.  
  160. #define NS_SVG_RENDERER_LIBART_CONTRACTID NS_SVG_RENDERER_CONTRACTID_PREFIX "LIBART"
  161.  
  162. // {A88E949D-AA36-4734-9C6E-F0FBCEF4FC47}
  163. #define NS_SVG_RENDERER_LIBART_CID \
  164. { 0xa88e949d, 0xaa36, 0x4734, { 0x9c, 0x6e, 0xf0, 0xfb, 0xce, 0xf4, 0xfc, 0x47 } }
  165.     
  166. #define NS_SVG_RENDERER_GDIPLUS_CONTRACTID NS_SVG_RENDERER_CONTRACTID_PREFIX "GDIPLUS"
  167.  
  168. // {D260F971-DB9D-425B-8C9B-4EB9605CE35D}
  169. #define NS_SVG_RENDERER_GDIPLUS_CID \
  170. { 0xd260f971, 0xdb9d, 0x425b, { 0x8c, 0x9b, 0x4e, 0xb9, 0x60, 0x5c, 0xe3, 0x5d } }
  171.  
  172. #define NS_SVG_RENDERER_CAIRO_CONTRACTID NS_SVG_RENDERER_CONTRACTID_PREFIX "CAIRO"
  173.  
  174. // {9f0fa438-1b1a-4a1b-a28d-91460542276e}
  175. #define NS_SVG_RENDERER_CAIRO_CID \
  176. { 0x9f0fa438, 0x1b1a, 0x4a1b, { 0xa2, 0x8d, 0x91, 0x46, 0x05, 0x42, 0x27, 0x6e } }
  177.  
  178. %}
  179.